import request from '@/utils/request';
import { Agent } from '@prisma/client';

export function getAgentList() {
  return request.post('/api/admin/agents/list');
}

export function getAgentPage(params: { current: number; pageSize: number; name?: string }) {
  return request.post('/api/admin/agents/page', params);
}

export function createAgent(data: Omit<Agent, 'id' | 'createdAt' | 'updatedAt'>) {
  return request.post('/api/admin/agents/create', data);
}

/**
 * 更新智能体
 * @param data
 * @returns
 */
export function updateAgent(data: Agent) {
  return request.post('/api/admin/agents/update', data);
}

/**
 * 删除智能体
 * @param id
 * @returns
 */
export function deleteAgent(id: string) {
  return request.post('/api/admin/agents/delete', { id });
}